import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import type { App } from 'vue'

const MyIcons = [
  'ArrowRightBold',
  'Message',
  'Location',
  'Link',
  'Close',
  'Reading',
  'Box',
  'Plus',
  'RefreshLeft',
  'RefreshRight',
  'UploadFilled'
] // 需要什么图标将名字写在这里即可
const MyIconsMap: any = {}

const temp: any = ElementPlusIconsVue
MyIcons.forEach((key: string) => {
  MyIconsMap[`${key}`] = temp[`${key}`]
})

export default function registerElementIcons(app: App) {
  for (const [key, component] of Object.entries(MyIconsMap)) {
    app.component(key, component as any)
  }
}
